/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package fait.ferm.ui;

import fait.ferm.global.Glob;
import fait.ferm.global.TB;
import java.io.IOException;
import java.net.URL;
import java.util.ResourceBundle;
import java.util.logging.Level;
import java.util.logging.Logger;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.fxml.Initializable;
import javafx.scene.control.TableView;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.GridPane;
import javafx.scene.layout.StackPane;

/**
 *
 * @author alex
 */
public class DogovorListController implements Initializable {
	@FXML
	private TableView<TB.Table5Col> dogTable;

	@Override
	public void initialize(URL url, ResourceBundle rb) {
		fillDogovorTable();
	}
	
	private void fillDogovorTable(){
		ObservableList<TB.Table5Col> items = FXCollections.observableArrayList();
		items.add(new TB.Table5Col("Завод по переработке молока №1", "Отсрочка 100% на 3 дня", "20", "45000", "2012-08-01"));
		items.add(new TB.Table5Col("ЧП Иванов", "Отсрочка 100% на 3 дня", "23", "5000", "2012-09-01"));
		TB.bind(dogTable);
		dogTable.setItems(items);
		
	}
	
	@FXML
	private void createDogovor(){
	try {
		FXMLLoader fl = new FXMLLoader(getClass().getResource("DogovorDialog2.fxml"));
		StackPane p = (StackPane) fl.load();
		//DogovorDialogController c = fl.getController();
		//c.returnedValue = 	personalRow;
		Glob.dialogPane.centerProperty().set(p);
		Glob.dialogPane.toFront();
	} catch (IOException ex) {
		Logger.getLogger(CreditTabController.class.getName()).log(Level.SEVERE, null, ex);
	}
		
	}
}
